// ProjectName: go-learn-demo
// PackageName: elasticybxb
// Description:
// Author: hy.bai
// Date: 2025-09-02 星期二 18:09

package elasticybxb

const ( // 定义单节点ElasticSearch的连接信息
	// ELASTIC_URL = "http://192.168.18.20:19200"
	ELASTIC_URL  = "https://192.168.18.20:19200"
	ELASTIC_USER = "elastic"
	// ELASTIC_PASSWORD = "dY9g-kD+oj_nlSAveJ3k"
	ELASTIC_PASSWORD = "+2*PMdSD5LNBxbuWG7+Q"
	ELASTIC_APIKEY   = "SUEtT0Naa0IyR0wzTDFURVFLZGg6UnFpdTU4a09nZ3A5N2JsaV9MZFFKdw=="
)

// 批量定义变量
const (
	// 索引名
	LOW_INDEX_NAME = "ybxb_index_low"
	ALL_INDEX_NAME = "ybxb_index_all"
	// 索引映射关系
	MAPPING = `{"mappings":{"dynamic":"strict","properties":{"id":{"type":"long"},"username":{"type":"keyword"},"nickname":{"type":"text"},"phone":{"type":"keyword"},"age":{"type":"integer"},"ancestral":{"type":"text"},"identity":{"type":"text"},"update_time":{"type":"long"},"create_time":{"type":"long"}}},"settings":{"index":{"number_of_shards":"1","number_of_replicas":"1"}}}`
	// 文档名字
	LOW_DOC_NAME         = "ybxb_document_low"
	LOW_DOC_NAME_WITH_ID = "ybxb_document_low_id"
	LOW_DOC_NAME_BATCH   = "ybxb_document_low_batch"
	ALL_DOC_NAME_STRING  = "ybxb_document_all_string"
	ALL_DOC_NAME_STRUCT  = "ybxb_document_all_struct"
	ALL_DOC_NAME_WITH_ID = "ybxb_document_all_id"
	ALL_DOC_NAME_BATCH   = "ybxb_document_all_batch"
)

// 书籍结构体
type Book struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	Author    string `json:"author"`
	TotalPage int    `json:"total_age"`
}
